package com.example.eos.bean;

import com.alibaba.fastjson.annotation.JSONField;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 评论信息
 */
public class Comment {
    private String commentid;

    @NotNull(message = "作品id不能为空")
    private String publishid;

    private String userid;

    @NotNull(message = "评论不能为空")
    @Length(min = 1, max = 500, message = "评论格式错误")
    private String content;

    private Integer replynum;

    @JSONField(format="yyyy-MM-dd HH:mm:ss")
    private Date cmttime;

    @Override
    public String toString() {
        return "Comment{" +
                "commentid='" + commentid + '\'' +
                ", publishid='" + publishid + '\'' +
                ", userid='" + userid + '\'' +
                ", content='" + content + '\'' +
                ", replynum=" + replynum +
                ", cmttime=" + cmttime +
                '}';
    }

    public String getCommentid() {
        return commentid;
    }

    public void setCommentid(String commentid) {
        this.commentid = commentid == null ? null : commentid.trim();
    }

    public String getPublishid() {
        return publishid;
    }

    public void setPublishid(String publishid) {
        this.publishid = publishid == null ? null : publishid.trim();
    }

    public String getUserid() {
        return userid;
    }

    public void setUserid(String userid) {
        this.userid = userid == null ? null : userid.trim();
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content == null ? null : content.trim();
    }

    public Integer getReplynum() {
        return replynum;
    }

    public void setReplynum(Integer replynum) {
        this.replynum = replynum;
    }

    public Date getCmttime() {
        return cmttime;
    }

    public void setCmttime(Date cmttime) {
        this.cmttime = cmttime;
    }
}